package bfgca;
import java.awt.BasicStroke;
import java.awt.Dimension;
import java.util.*;

public class StarSystem {
  private ArrayList<StarSystem> adjacentSystems;
  private ArrayList<Vessel> presentVessels;
  private ArrayList<Planet> sysPlanets;
  private Coordinate graphPosition;
  private String name;
  
  public StarSystem(int x, int y, String name) throws DrawingPositionException{
    adjacentSystems = new ArrayList<StarSystem>();
    presentVessels = new ArrayList<Vessel>();
    sysPlanets = new ArrayList<Planet>();
    if(x > 10 || x < 1 || y > 10 || y < 1){
      throw new DrawingPositionException("supplied coordinates outside of" +
      		" accepted positions (1 - 10)" );
    }
    graphPosition = new Coordinate(x, y);
    this.name = name;
  }
  
  public ArrayList<Vessel> getPresentVessels(){ return this.presentVessels;}
  public ArrayList<StarSystem> getAdjacentSystems(){return this.adjacentSystems;}
  public ArrayList<Planet> getSystemPlanets() {return this.sysPlanets; }
  public int getX(){return this.graphPosition.x;}
  public int getY(){return this.graphPosition.y;}
  public void setCoordinates(int x, int y) throws DrawingPositionException{
    if(x > 10 || x < 1 || y < 10 || y < 10){
      throw new DrawingPositionException("supplied coordinates outside of" +
          " accepted positions (1 - 10)" );
    }
    this.graphPosition.x = x;
    this.graphPosition.y = y;
  }
  public void setPlanets(ArrayList<Planet> planets){
    this.sysPlanets = planets;
  }
  public String toString(){ return this.name;}
}
